 package srdb.migration.schema.metadata;
 
 public class Constraint extends DBObject
 {
   private String contraintName = null;
   private Table parentTable = null;
   private String deleteRule = null;
   private String updateRule = null;
   private String refIntSchemaName = null;
   private String refIntTableName = null;
   private char type;
   private String searchCondition = null;
   private ColumnList columns = null;
   private ColumnList refIntColumns = null;
 
   private boolean caseSensitive = false;
   private String fillFactor;
   private String fkMatchType = null;
 
   public String getFillFactor()
   {
     return this.fillFactor;
   }
 
   public void setFillFactor(String fillFactor)
   {
     this.fillFactor = fillFactor;
   }
 
   public Constraint()
   {
   }
 
   public Constraint(Table parentTable, String ConstraintName, boolean caseSensitive) {
     this.parentTable = parentTable;
     this.contraintName = ConstraintName;
     this.caseSensitive = caseSensitive;
   }
 
   public void setDeleteRule(String delRule) {
     this.deleteRule = delRule;
   }
 
   public String getDeleteRule() {
     return this.deleteRule;
   }
   public void setType(char Type) {
     this.type = Type;
   }
 
   public void setRefIntegrityTable(String RefIntegrityTable) {
     this.refIntTableName = RefIntegrityTable;
   }
 
   public void setSearchCondition(String SearchCondition) {
     this.searchCondition = SearchCondition;
   }
 
   public char getType() {
     return this.type;
   }
 
   public String getSearchCondition() {
     return this.searchCondition;
   }
 
   public String getName() {
     return this.contraintName;
   }
 
   public void setName(String name) {
     this.contraintName = name;
   }
 
   public String getTableName() {
     return this.parentTable != null ? this.parentTable.getName() : null;
   }
 
   public String getRefIntegrityTable() {
     return this.refIntTableName;
   }
 
   public void setRefIntSchemaName(String refIntSchemaName) {
     this.refIntSchemaName = refIntSchemaName;
   }
 
   public String getRefIntSchemaName() {
     return this.refIntSchemaName;
   }
 
   public String getRefIntegritySchemaQualifiedTableName()
   {
     return this.refIntSchemaName + "." + this.refIntTableName;
   }
 
   public ColumnList getColumns() {
     if (this.columns == null)
       this.columns = new ColumnList();
     return this.columns;
   }
 
   public void addColumn(Column column) {
     if (this.columns == null) {
       this.columns = new ColumnList();
     }
     this.columns.add(column);
   }
 
   public ColumnList getRefIntegrityColumns() {
     if (this.refIntColumns == null)
       this.refIntColumns = new ColumnList();
     return this.refIntColumns;
   }
 
   public void addRefIntegrityColumn(Column column) {
     if (this.refIntColumns == null) {
       this.refIntColumns = new ColumnList();
     }
     this.refIntColumns.add(column);
   }
 
   public String getName(boolean quoted)
   {
     if ((this.caseSensitive) && (this.contraintName != null)) {
       return "\"" + this.contraintName + "\"";
     }
 
     return this.contraintName;
   }
 
   public boolean isCaseSensitive() {
     return this.caseSensitive;
   }
 
   public DBObject getParent() {
     return this.parentTable;
   }
 
   public String getSchema()
   {
     if (this.parentTable != null) {
       return this.parentTable.getSchema();
     }
     return null;
   }
 
   public void setUpdateRule(String updateRule) {
     this.updateRule = updateRule;
   }
 
   public String getUpdateRule() {
     return this.updateRule;
   }
 
   public String getFkMatchType() {
     return this.fkMatchType;
   }
 
   public void setFkMatchType(String fkMatchType) {
     this.fkMatchType = fkMatchType;
   }
 
   public String getSchemaQualifiedTableName()
   {
     assert ((getSchema() != null) && (getTableName() != null));
     return getSchema() + "." + getTableName();
   }
 }

/* 

 * 
 */